package com.hwn.datax.domain;

import cn.hutool.setting.Setting;
import com.hwn.datax.domain.datax.RangeOption;
import com.hwn.datax.domain.datax.Reader;
import com.hwn.datax.domain.datax.Writer;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Map;

/**
 * datax任务
 *
 * @TableName datax_job
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class DataxJob extends BaseTableField implements Serializable {
    /**
     * 主键
     */
    private Long id;

    /**
     * 任务名称
     */
    private String jobName;

    /**
     * 配置对象
     */
    private Setting setting;

    /**
     * 分组ID
     */
    private Long groupId;
    /**
     * 输入对象
     */
    private Reader reader;

    /**
     * 输出对象
     */
    private Writer writer;

    /**
     * 任务参数
     */
    private String jobParams;

    /**
     * 服务器id
     */
    private Integer serverId;

    /**
     * json路径
     */
    private String jsonPath;

    private String uuid;

    /**
     * JVM启动参数
     */
    private String jvmParams;

    private String logPath;


    private RangeOption rangeOption = new RangeOption();


    private static final long serialVersionUID = 1L;


    @Data
    public static class Setting {
        private Map<String,Object> speed;
        private ErrorLimit errorLimit;
    }

    @Data
    public static class ErrorLimit {
        private Integer record;
        private Double percentage;
    }
}